/**
 * 将对象转为 map 结构
 * @param {Array<object>} target
 * @param {String} key
 */
export default (target, key) => {
  return target.reduce((acc, item) => {
    acc[item[key]] = item
    return acc
  }, {})
}
